# coding:utf-8
from sqlalchemy import inspect, Column, Integer, String, SmallInteger, Text, orm
from app.models.base import Base



class Role(Base):
    __tablename__ = 'role'
    id = Column(Integer, primary_key=True, autoincrement=True, comment='主键')
    name = Column(String(50), nullable=False, comment='角色名称')
    status = Column(SmallInteger, default=1, comment='角色状态')
    description = Column(Text(), default='', comment='简介')

    @orm.reconstructor
    def __init__(self):
        self.fields = ['id', 'name', 'status', 'description']
